
package geomatic.android;

import org.geonames.*;

public class Util
{
	public static String toString(Address a)
	{
		if (a == null)
		{
			return "";
		}
		else
		{
			StringBuilder sb = new StringBuilder();
			sb.append(a.getPlaceName());
			sb.append(" ");
			if (a.getStreetNumber() != null)
			{
				sb.append(a.getStreetNumber());
				sb.append(" ");
			}
			sb.append(a.getStreet());
			sb.append(" ");
			sb.append(a.getPostalCode());
			return sb.toString();
		}
	}

	public static String toString(Toponym top)
	{
		if (top == null)
		{
			return "";
		}
		else
		{
			StringBuilder sb = new StringBuilder();
			sb.append(top.getName());
			sb.append(" ");
			sb.append(top.getCountryName());
			sb.append(" ");
			return sb.toString();
		}
	}

	public static String toString(WikipediaArticle article)
	{
		if (article == null)
		{
			return "";
		}
		else
		{
			StringBuilder sb = new StringBuilder();
			sb.append(article.getTitle());
			return sb.toString();
		}
	}

}
